<form class="layui-form" action="">
    <input name="etId" id="etId1" type="hidden" />

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">配置名称:</label>
            <div class="layui-input-inline">
                <input type="text" name="etName" id="etName1" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注:</label>
            <div class="layui-input-inline">
                <input type="text" name="etRemark" id="etRemark1" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">配置类型:</label>
        <div class="layui-input-block">
            <input type="radio" name="conType" value="1" title="结构同步" checked="">
            <input type="radio" name="conType" value="2" title="数据同步">
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">是否启用:</label>
            <div class="layui-input-block">
                <input type="checkbox" checked="" name="etEnable" id="etEnable1" lay-skin="switch" lay-filter="switchTest" lay-text="启用|停用">
            </div>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">是否公开:</label>
            <div class="layui-input-block">
                <input type="checkbox" checked="" name="etPublic" id="etPublic1" lay-skin="switch" lay-filter="switchTest" lay-text="公开|私有">
            </div>
        </div>
    </div>


</form>

<script>
    $(function(){
        var data = $('#page-com').data('tabCon');

        if (data != null){
            document.getElementById("etId1").value= data.id;
            document.getElementById("etName1").value= data.name;
            document.getElementById("etRemark1").value= data.remark;
            $("input[name='conType'][value="+data.conType+"]").attr("checked",true);
            if (data.isEnable == '1'){
                $('#etEnable1').attr('checked', true);
            }else {
                $('#etEnable1').attr('checked', false);
            }
            if (data.isPublic == '1'){
                $('#etPublic1').attr('checked', true);
            }else {
                $('#etPublic1').attr('checked', false);
            }

            $('#page-com').data('tabCon',null);
        }


        layui.use('form', function(){
            var form = layui.form;
            form.render('radio');
            form.render('checkbox');
        });
    })




</script>